﻿using Microsoft.AspNetCore.Mvc;
using PowerHub.MES.Common.Utility;
using PowerHub.MES.DTO.Crew.DTO;
using PowerHub.MES.DTO.Crew.QueryDto;
using PowerHub.MES.DTO.Shopfloor.DTO;
using PowerHub.MES.DTO.Shopfloor.QueryDTO;
using PowerHub.MES.Entities.Crew;
using PowerHub.MES.Entities.Shopfloor;
using PowerHub.MES.IServices.ICrew;
using PowerHub.MES.IServices.IShopfloor;
using PowerHub.MES.ReturnEntity;

namespace PowerHub.MES.Controllers.Crew
{
    /// <summary>
    /// 班组类型
    /// </summary>
    [ApiController]
    [Route("Api/MES/Crew/[controller]/[action]")]
    public class TeamTypeController
    {

        private ICrew_TeamTypeServices _Crew_TeamTypeServices;

        public TeamTypeController(ICrew_TeamTypeServices TeamTypeServices)
        {
            _Crew_TeamTypeServices = TeamTypeServices;
        }

        /// <summary>
        /// 获取班组类型列表
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        [HttpPost]
        [FunctionDescription("获取班组类型列表")]
        public async Task<OperationPageResult<List<Crew_TeamType>>> GetCrew_TeamTypePageListAsync([FromBody] QueryCrew_TeamTypeDTO pageQuery)
        {
            return await _Crew_TeamTypeServices.GetCrew_TeamTypePageListAsync(pageQuery);
        }


        /// <summary>
        /// 批量删除班组类型
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        [HttpPost]
        [FunctionDescription("批量删除班组类型")]
        public async Task<OperationResult<bool>> DeletionCrew_TeamTypeAsync([FromBody] List<string> Query)
        {
            return await _Crew_TeamTypeServices.DeletionCrew_TeamTypeAsync(Query);
        }

        /// <summary>
        /// 更新班组类型
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        [HttpPost]
        [FunctionDescription("更新班组类型")]
        public async Task<OperationResult<bool>> UpdateCrew_TeamTypeAsync([FromBody] Crew_TeamTypeDTO Query)
        {
            return await _Crew_TeamTypeServices.UpdateCrew_TeamTypeAsync(Query);
        }

        /// <summary>
        /// 添加班组类型
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        [HttpPost]
        [FunctionDescription("添加班组类型")]
        public async Task<OperationResult<bool>> CreateCrew_TeamTypeAsync([FromBody] Crew_TeamTypeDTO Query)
        {
            return await _Crew_TeamTypeServices.CreateCrew_TeamTypeAsync(Query);
        }
    }
}
